<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddRewardsToProductSkusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('product_skus', function (Blueprint $table) {
            $table->decimal('rewards', 10, 2)->nullable()->default(0);
            $table->decimal('own_rewards', 10, 2)->nullable()->default(0);
            $table->decimal('parent_rewards', 10, 2)->nullable()->default(0);
            $table->decimal('team_rewards', 10, 2)->nullable()->default(0);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('product_skus', function (Blueprint $table) {
             $table->dropColumn(['rewards','own_rewards','parent_rewards','team_rewards']);
        });
    }
}
